#Given a list of scientist
scientists = ['Marie Curie', 'Albert Einstein', 'Niels Bohr',
    'Isaac Newton', 'Dmitri Mendeleev', 'Antoine Lavoisier',
    'Carl Linnaeus', 'Alfred Wegener', 'Charles Darwin']

#Fetch the last word from 'name', and use that to sort the list
sorted(scientists, key=lambda name: name.split()[-1])

#We can define this lambda expression ahead of time if we want
last_name = lambda name: name.split()[-1]
last_name

#And use it just like a function
last_name("Nikola Tesla")

#This is equivalent to defining a regular function using def
def first_name(name):
  return name.split()[0]

first_name("Nikola Tesla")